package com.qf.service.impl;

import com.qf.dao.EmpDao;
import com.qf.entity.Emp;
import com.qf.entity.Users;
import com.qf.service.EmpService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 2019/9/29
 * Administrator
 * springdata0928
 * 面向对象面向君  不负代码不负卿
 */
@Service("empservice")
public class EmpServiceImpl implements EmpService {
    @Resource
    private EmpDao empDao;
    @Transactional
    public Emp insertEmp(Emp emp) {
        return empDao.save(emp);
    }

    public Emp findbyname(String name) {
        return empDao.findByEmpName(name);
    }

    public List<Emp> findbydname(String dname) {
        return empDao.findByDept_DeptName(dname);
    }
}
